import Vue from "vue";
import {
	formatDateTime
} from './util.js'


  // 时间戳转换
  function  getFormatDuringTime(date,type) {
	//date是秒数
	var d = new Date(date * 1000),
	  month = "" + (d.getMonth() + 1),
	  day = "" + d.getDate(),
	  year = d.getFullYear(),
	  hour = d.getHours(),
	  minute = d.getMinutes(),
	  seconds = d.getSeconds();
	month = parseInt(month) < 10 ? "0" + month : month;
	day = parseInt(day) < 10 ? "0" + day : day;
	hour = parseInt(hour) < 10 ? "0" + hour : hour;
	minute = parseInt(minute) < 10 ? "0" + minute : minute;
	seconds = parseInt(seconds) < 10 ? "0" + seconds : seconds;
	if(type=='point'){
		return (
			year +
			"." +
			month +
			"." +
			day +
			" " +
			hour +
			":" +
			minute +
			":" +
			seconds
			);
	}
	if(type=='division'){
		return (
			month +
			"/" +
			day +
			" " +
			hour +
			":" +
			minute +
			":" +
			seconds
		  );
	}
	if(type=='iosTime'){
		return (
			year +
			"/" +
			month +
			"/" +
			day +
			" " +
			hour +
			":" +
			minute +
			":" +
			seconds
		  );
	}
	
  }



module.exports = {
	getFormatDuringTime,
}
